import fetch from 'common/src/utils/fetch';

// 查询毕业审核批次
export function findAllGraduateReviewBatch(data) {
  return fetch({
    url: '/api/graduationservice/suspendToGraduateReviewBatch/findAllGraduateReviewBatch',
    method: 'post',
    data
  })
}
// 查询毕业生名单
export function findGraduateList(data) {
  return fetch({
      url: '/api/graduationservice/suspendToGraduateList/findGraduateList',
      method: 'post',
      data
  })
}


// 查询毕业结论不一致说明申请
export function findConclusionConformityAuditList(data) {
  return fetch({
      url: '/api/graduationservice/suspendToGraduateList/findConclusionConformityAuditList',
      method: 'post',
      data
  })
}
// 查询毕业结论不一致说明申请查看
export function findConclusionConformityApplyList(data) {
  return fetch({
      url: '/api/graduationservice/suspendToGraduateList/findConclusionConformityApplyList',
      method: 'post',
      data
  })
}
// 毕业结论不一致说明审核—通过
export function conclusionConformityAuditPass(data) {
  return fetch({
      url: '/api/graduationservice/suspendToGraduateList/conclusionConformityAuditPass',
      method: 'post',
      data
  })
}
// 毕业结论不一致说明审核—不通过
export function conclusionConformityAuditNoPass(data) {
  return fetch({
      url: '/api/graduationservice/suspendToGraduateList/conclusionConformityAuditNoPass',
      method: 'post',
      data
  })
}
// 保存审核结论
export function saveOrSubmitCollegeAudit(data) {
  return fetch({
      url: '/api/graduationservice/suspendToGraduateList/saveOrSubmitCollegeAudit',
      method: 'post',
      data
  })
}
// 设置机审
export function setMachine(data) {
  return fetch({
      url: '/api/graduationservice/suspendToGraduateList/setMachine',
      method: 'post',
      data
  })
}
// 毕业生名单—设置学位证书编号
export function editCertificateNo(data) {
  return fetch({
      url: '/api/graduationservice/suspendToGraduateList/editCertificateNo',
      method: 'post',
      data
  })
}
// 毕业生名单—设置辅修专业证书编号
export function editMinorCertificateNo(data) {
  return fetch({
      url: '/api/graduationservice/suspendToGraduateList/editMinorCertificateNo',
      method: 'post',
      data
  })
}
// 毕业生名单—退回审核结论
export function saveReturnReviewConclusion(data) {
  return fetch({
      url: '/api/graduationservice/suspendToGraduateList/saveReturnReviewConclusion',
      method: 'post',
      data
  })
}
//毕业生名单— 初始化毕业生名单
export function createGraduateList(data) {
  return fetch({
      url:
          '/api/graduationservice/suspendToGraduateList/createGraduateList?grade=' +
          data.graduationDate +
          '&isOverseas=' +
          data.isOverseas,
      method: 'GET'
  })
}
//查询机审详情
export function getMachineDetail(studentID){
  return fetch({
      url: `/api/graduationservice/suspendToGraduateList/getMachineDetail?studentID=${studentID}`,
      method: 'get'
  })
}
// 毕业生名单—退回审核结论
export function selectCurrentBatch(data) {
  return fetch({
      url: '/api/graduationservice/suspendToGraduateReviewAuth/selectCurrentBatch',
      method: 'post',
      data
  })
}
// 设置机审-RedisResul获取数据
export function getRedisResult(data) {
  return fetch({
    url: '/api/graduationservice/suspendToGraduateList/result/' + data,
    method: 'get',
    data
  })
}
//设置是否有效
export function editIsValidity(data){
  return fetch({
    url: '/api/graduationservice/suspendToGraduateList/editIsValidity',
    method: 'post',
    data

  })
}
//提交审核详情
export function setReviewConclusion(data){
  return fetch({
    url: '/api/graduationservice/suspendToGraduateList/setReviewConclusion',
    method: 'post',
    data
  })
}
// 毕业结论不一致说明申请—查询专业
export function findProfessionList(data) {
  return fetch({
      url: '/api/graduationservice/suspendToGraduateList/findProfessionList',
      method: 'post',
      data
  })
}

/**
 * 查询当前学生上一位、下一位的学生id
 * step 0:下一步；1：上一步
 * isOverseas 0:国内生；1留学生
 * currentStudentId :当前学生ID
 */
export function findPreviousOrNextStep(data){
    return fetch ({
        url:`/api/graduationservice/suspendToGraduateList/findPreviousOrNextStep`,
        method: 'post',
        data
    })
}

export function printPdfInList(param) {
    return fetch({
        url: `/api/graduationservice/suspendToGraduateList/print?${param}`,
        method: 'get'
    })
}

export function exportReissueCertificateListPdf(param) {
    return fetch({
        url: `/api/graduationservice/suspendToGraduateList/exportReissueCertificateList?${param}`,
        method: 'get'
    })
}

// 名单页面打印 弹框打印pdf
export function findFaculty(params) {
    let authId = localStorage.getItem('activeAuthId');
    params = params || {};
    params.authId = authId || '';
    return fetch({
        url: '/api/graduationservice/suspendToGraduateList/findFacultyWithGraduates',
        params
    })
}